import request from "@/utils/request"

// 查询代理列表
export function queryList(query) {
  return request({
    url: '/user/distribution/agent/list',
    method: 'get',
    params: query
  })
}

// 查询分公司和总公司列表
export function queryCompanyList(query) {
  return request({
    url: '/user/distribution/city/getBranch',
    method: 'get',
    params: query
  })
}

// 新增分公司信息
export function addInfo(query) {
  return request({
    url: '/user/distribution/agent/add',
    method: 'post',
    data: query
  })
}

// 获取分公司信息
export function queryInfo(query) {
  return request({
    url: '/user/distribution/agent/' + query,
    method: 'get',
    params: query
  })
}

// 修改分公司信息
export function editInfo(query) {
  return request({
    url: '/user/distribution/agent/edit',
    method: 'post',
    data: query
  })
}


// 删除分公司信息
export function deleteInfo(query) {
  return request({
    url: '/user/distribution/agent/delete?ids=' + query,
    method: 'get',
  })
}

// 分公司代理级联列表
export function queryBranchAndAgent(query) {
  return request({
    url: '/user/distribution/city/getBranchAndAgent',
    method: 'get',
  })
}

// 获取分公司下代理列表
export function queryAgentByBranchId(query) {
  return request({
    url: '/user/distribution/agent/getAgentByBranchId',
    method: 'get',
    params: query
  })
}
